﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace EnterpriseFund.BLL
{
    public class Common
    {
        private readonly DAL.Common dal = new DAL.Common();
             /// <summary>
        /// 分页获取数据列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="strWhere"></param>
        /// <param name="fOrderFiled"></param>
        /// <returns></returns>
        public DataSet GetListByPage(string table, string fields, int PageSize, int PageIndex, string strWhere, string fOrderFiled, out int total)
        {
            return dal.GetListByPage(table, fields, PageSize, PageIndex, strWhere, fOrderFiled, out total);
        }

                /// <summary>
        ///获取年度
        /// </summary>
        /// <param name="year"></param>
        /// <returns></returns>
        public DataSet GetYear()
        {
            return dal.GetYear();
        }

        public void YearTransfer(string year, List<Model.SupportPolicy> sl)
        {
            dal.YearTransfer(year, sl);
        }

              /// <summary>
        /// 年度反结转
        /// <creator>zhongyl</creator>
        /// <date>2014-11-07</date>
        /// </summary>
        /// <param name="year"></param>
        /// <param name="FStatus"></param>
        /// <returns></returns>
        public void YearTurnChange(decimal year)
        {
            dal.YearTurnChange(year);
        }

                /// <summary>
        /// 获取比较数据（sql）
        /// </summary>
        /// <param name="year"></param>
        /// <returns></returns>
        public DataSet GetCompareDataBySQL(string tableName, string colunms)
        {
            return dal.GetCompareDataBySQL(tableName, colunms);
        }

             /// <summary>
        /// 获取比较数据（ora）
        /// </summary>
        /// <param name="year"></param>
        /// <returns></returns>
        public DataSet GetCompareDataByOra(string tableName, string colunms)
        {
            return dal.GetCompareDataByOra(tableName, colunms);
        }

        
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="strWhere"></param>
        /// <param name="fOrderFiled"></param>
        /// <returns></returns>
        public DataSet GetListByPage2(string table, string fields, int PageSize, int PageIndex, string strWhere, string fOrderFiled, out int total)
        {
            return dal.GetListByPage2(table, fields, PageSize, PageIndex, strWhere, fOrderFiled, out total);
        }

                /// <summary>
        /// 获取剔除数据
        /// </summary>
        /// <param name="year"></param>
        /// <returns></returns>
        public string GetGetRejectTaxSqlByYear(string year)
        {
            return dal.GetGetRejectTaxSqlByYear(year);
        }

                /// <summary>
        /// 更新比较数据（sql）
        /// </summary>
        /// <param name="year"></param>
        /// <returns></returns>
        public void UpdateCompareData(string key, string tableName, string colunms, DataRow[] addDr, DataRow[] EditDr)
        {
            dal.UpdateCompareData(key, tableName, colunms, addDr, EditDr);
        }
    }
}
